package cn.iocoder.yudao.module.member.dal.mysql.useranswerremark;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.useranswerremark.UserAnswerRemarkDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.useranswerremark.vo.*;

/**
 * 用户问答评论 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserAnswerRemarkMapper extends BaseMapperX<UserAnswerRemarkDO> {

    default PageResult<UserAnswerRemarkDO> selectPage(UserAnswerRemarkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserAnswerRemarkDO>()
                .betweenIfPresent(UserAnswerRemarkDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UserAnswerRemarkDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserAnswerRemarkDO::getProblemId, reqVO.getProblemId())
                .eqIfPresent(UserAnswerRemarkDO::getRemark, reqVO.getRemark())
                .eqIfPresent(UserAnswerRemarkDO::getGreat, reqVO.getGreat())
                .eqIfPresent(UserAnswerRemarkDO::getColl, reqVO.getColl())
                .eqIfPresent(UserAnswerRemarkDO::getBad, reqVO.getBad())
                .eqIfPresent(UserAnswerRemarkDO::getParentId, reqVO.getParentId())
                .orderByDesc(UserAnswerRemarkDO::getId));
    }

}